Table of Contents

1. Part 1

1.1. Getting Unit Tests

1.2. Profiling

1.2.1. Runtime assessment on a program level

1.2.2. Runtime assessment on a function level

1.2.3. Profiling memory consumption

1.3. Image Scalability

1.4. Optimizations

1.4.1. Cython

1.4.2. CV2 + Numpy

1.4.2.1. Evaluate the approach

1.4.2.2. Compare the Hamming distances between the approaches

1.4.3. Spark

2. Part 2

2.1. Get the differences between the hashing algorithms

2.2. Compute a separate threshold for all of the groups

2.3. Computing the difference macro F1-scores

2.4. Compare for new hash identification

2.5. Comparing the timing of the hashing algorithms

1. Part 1

1.1. Getting Unit Tests

1.2. Profiling

1.2.1. Runtime assessment on a program level

The library $gprof2dot$ is used for generating the code. It was used/generated on my local PC, as the server did not have the required extensions to launch it and generate it.

1.2.2. Runtime assessment on a function level

Runtime was assessed by using the @profile decorators.

1.2.3. Profiling memory consumption

The visual image for memory consumption (memory consumption vs the number of time a program is running) was plotted using memory-profiler and unix commands

Get memit times for different number of images:

1.3. Image scalability

The file that generated the $.json$ outputs is $run\_time\_comparison.py$

1.4. Optimizations

1.4.1. Cython

1.4.2. Numpy + CV2

1.4.2.1. Evaluate the approach

1.4.2.2. Compare the Hamming distances between the approaches

1.4.3. Spark

Timing generated from $pysparkex.py$ and $FINd\_multiprocessing.py$ under Optimizations/Spark

Part 2

2.1. Get the differences between the hashing algorithms

The relative performance might be different due to different hash sizes. It can be adjusted, if necessary. It is thus compared for each group separately.

2.2. Compute a separate threshold for all of the groups

2.3. Computing the difference macro F1-scores

Measurement comparison:

  1. Extract 100 groups with 10 images each
  2. Compare the 10 images within + with other 20 random images outside
  3. Compute the F1 score for each group
  4. Get a macro-averaged F1 score.

This enables us to compute the F1 score for more groups given the high group heterogeneity. The reason why F1 is because there is huge class imbalance from the perspective of each group (you'd like to find all (recall) and make sure that each of your individual guesses is correct (precision). This allows to test the hashing algorithm more generally.

2.4. Compare for new hash identification

The images below display the "guess" image and the "truth" image one next to each other.

2.5. Comparing the timing of the hashing algorithms

Times for a certain number of images